/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ultrasoft.farmasoft.domain;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Administrador
 */
@Entity
@Table(name = "typeparameter")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Typeparameter.findAll", query = "SELECT t FROM Typeparameter t"),
    @NamedQuery(name = "Typeparameter.findByTypeParameterId", query = "SELECT t FROM Typeparameter t WHERE t.typeParameterId = :typeParameterId"),
    @NamedQuery(name = "Typeparameter.findByName", query = "SELECT t FROM Typeparameter t WHERE t.name = :name"),
    @NamedQuery(name = "Typeparameter.findByDetail", query = "SELECT t FROM Typeparameter t WHERE t.detail = :detail")})
public class Typeparameter implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "typeParameterId")
    private Short typeParameterId;
    @Basic(optional = false)
    @Column(name = "name")
    private String name;
    @Basic(optional = false)
    @Column(name = "detail")
    private String detail;
    @OneToMany(mappedBy = "typeParameterId")
    private Collection<Parameter> parameterCollection;

    public Typeparameter() {
    }

    public Typeparameter(Short typeParameterId) {
        this.typeParameterId = typeParameterId;
    }

    public Typeparameter(Short typeParameterId, String name, String detail) {
        this.typeParameterId = typeParameterId;
        this.name = name;
        this.detail = detail;
    }

    public Short getTypeParameterId() {
        return typeParameterId;
    }

    public void setTypeParameterId(Short typeParameterId) {
        this.typeParameterId = typeParameterId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    @XmlTransient
    public Collection<Parameter> getParameterCollection() {
        return parameterCollection;
    }

    public void setParameterCollection(Collection<Parameter> parameterCollection) {
        this.parameterCollection = parameterCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (typeParameterId != null ? typeParameterId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Typeparameter)) {
            return false;
        }
        Typeparameter other = (Typeparameter) object;
        if ((this.typeParameterId == null && other.typeParameterId != null) || (this.typeParameterId != null && !this.typeParameterId.equals(other.typeParameterId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ultrasoft.farmasoft.domain.Typeparameter[ typeParameterId=" + typeParameterId + " ]";
    }
    
}
